﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ScriptEditor.Commands
{
    class Command_Dialogue : Command
    {
        public string text
        {
            get
            {
                return Text;
            }
            set
            {
                Text = value;
            }
        }
        public string name
        {
            get
            {
                return Value1;
            }
            set
            {
                Value1 = value;
            }
        }
        public bool newpage
        {
            get
            {
                return bool.TryParse(Value2, out bool result) ? result : true;
            }
            set
            {
                Value2 = value.ToString();
            }
        }
        public string charName
        {
            get
            {
                return Value3;
            }
            set
            {
                Value3 = value;
            }
        }
        public string voiceName
        {
            get
            {
                return Value4;
            }
            set
            {
                Value4 = value;
            }
        }
        public bool addHistory
        {
            get
            {
                return bool.TryParse(Value5, out bool result) ? result : true;
            }
            set
            {
                Value5 = value.ToString();
            }
        }
        public string textJp
        {
            get
            {
                return Value6;
            }
            set
            {
                Value6 = value;
            }
        }
        public string textTc
        {
            get
            {
                return Value7;
            }
            set
            {
                Value7 = value;
            }
        }
        public string speakerJp
        {
            get
            {
                return Value8;
            }
            set
            {
                Value8 = value;
            }
        }
        public string speakerTc
        {
            get
            {
                return Value9;
            }
            set
            {
                Value9 = value;
            }
        }
        public Command_Dialogue()
        {
            CommandType = COMMANDTYPE.Dialogue;
            text = "请输入文本";
            name = "";
            newpage = true;
            charName = "";
            voiceName = "";
            addHistory = true;
            textJp = "";
            textTc = "";
            speakerJp = "";
            speakerTc = "";
            Wait = true;
        }
        public Command_Dialogue(string Text, string Name, bool Newpage, string CharName, string VoiceName, bool AddHistory = true, string TextJp = "", string TextTc = "", string SpeakerJp = "", string SpeakerTc = "")
        {
            CommandType = COMMANDTYPE.Dialogue;
            text = Text;
            name = Name;
            newpage = Newpage;
            charName = CharName;
            voiceName = VoiceName;
            addHistory = AddHistory;
            textJp = TextJp;
            textTc = TextTc;
            speakerJp = SpeakerJp;
            speakerTc = SpeakerTc;
            Wait = true;
        }
        public override string ToString()
        {
            return CommandType.ToString() + ":\n" + "显示对话：" + text;
        }
    }
}
